package com.zhss.eshop.wms.service.handler;


import com.zhss.eshop.purchase.service.PurchaseService;
import com.zhss.eshop.wms.domain.dto.WmsPurchaseInputOrderDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 4`通知采购中心的handler
 * @author suyuan
 *
 */
@Component
public class InformPurchaseCenterHandler extends AbstractPurchaseInputOrderHandler {

	/**
	 * 采购中心接口
	 */
	@Autowired
	private PurchaseService purchaseService;

	/**
	 * 执行处理逻辑
	 */
	@Override
	public PurchaseInputOrderHandlerResult doExecute(
			WmsPurchaseInputOrderDTO purchaseInputOrder) throws Exception {
		purchaseService.informFinishedPurchaseInputOrderEvent(
				purchaseInputOrder.getPurchaseOrderId());
		return new PurchaseInputOrderHandlerResult(true);
	}

}
